package com.fsl.springbootdesignpattern.a_singleton;

/**
 * @author sj2
 * 懒汉式，线程安全
 */
public class SingletonB {

    private static SingletonB singletonB;

    private SingletonB(){}

    private static synchronized SingletonB getInstance(){
        if(singletonB==null){
            singletonB = new SingletonB();
        }
         return singletonB;
    }
}
